package com.renwei.yunlong.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.renwei.yunlong.R;
import com.renwei.yunlong.base.BaseActivity;
import com.zyf.fwms.commonlibrary.utils.AutoUtils;
import com.zyf.fwms.commonlibrary.utils.CommonUtils;
import com.zyf.fwms.commonlibrary.utils.StatusBarUtil;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * 添加员工--页面
 * <p>
 * Created by Administrator on 2017/8/29.
 */

public class AddEmployeeActivity extends BaseActivity implements View.OnClickListener {


    @Bind(R.id.iv_back)
    ImageView ivBack;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.rl_name)
    RelativeLayout rlName;
    @Bind(R.id.rl_job_number)
    RelativeLayout rlJobNumber;
    @Bind(R.id.rl_login)
    RelativeLayout rlLogin;
    @Bind(R.id.btn_man)
    Button btnMan;
    @Bind(R.id.btn_woman)
    Button btnWoman;
    @Bind(R.id.rl_department)
    RelativeLayout rlDepartment;
    @Bind(R.id.rl_grouping)
    RelativeLayout rlGrouping;
    @Bind(R.id.rl_character)
    RelativeLayout rlCharacter;
    @Bind(R.id.btn_start)
    Button btnStart;
    @Bind(R.id.btn_close)
    Button btnClose;
    @Bind(R.id.rl_email)
    RelativeLayout rlEmail;
    @Bind(R.id.rl_phone)
    RelativeLayout rlPhone;
    @Bind(R.id.rl_contact)
    RelativeLayout rlContact;
    @Bind(R.id.btn_determine_add)
    Button btnDetermineAdd;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_add_employee);
        ButterKnife.bind(this);

        StatusBarUtil.setColor(this, CommonUtils.getColor(this, R.color.title_color), 0);
        //屏幕自适配
        AutoUtils.setSize(this, false, 720, 1280);
        AutoUtils.auto(this);

        initData();

    }

    private void initData() {
        ivBack.setVisibility(View.VISIBLE);
        ivBack.setOnClickListener(this);
        tvTitle.setText("添加员工");

        rlName.setOnClickListener(this);
        rlJobNumber.setOnClickListener(this);
        rlLogin.setOnClickListener(this);
        btnMan.setOnClickListener(this);
        btnWoman.setOnClickListener(this);
        rlDepartment.setOnClickListener(this);
        rlGrouping.setOnClickListener(this);
        rlCharacter.setOnClickListener(this);
        btnStart.setOnClickListener(this);
        btnClose.setOnClickListener(this);
        rlEmail.setOnClickListener(this);
        rlPhone.setOnClickListener(this);
        rlContact.setOnClickListener(this);
        btnDetermineAdd.setOnClickListener(this);


    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.rl_name://员工姓名
                break;
            case R.id.rl_job_number://员工工号
                break;
            case R.id.rl_login://登录手机
                break;
            case R.id.btn_man://男
                btnMan.setBackgroundResource(R.drawable.shape_deal_solved_dialog_pre);
                btnMan.setTextColor(getResources().getColor(R.color.white));
                btnWoman.setBackgroundResource(R.drawable.shape_deal_unsolved_dialog_nor);
                btnWoman.setTextColor(getResources().getColor(R.color.text_black_color));
                break;
            case R.id.btn_woman://女
                btnMan.setBackgroundResource(R.drawable.shape_deal_solved_dialog_nor);
                btnMan.setTextColor(getResources().getColor(R.color.text_black_color));
                btnWoman.setBackgroundResource(R.drawable.shape_deal_unsolved_dialog_pre);
                btnWoman.setTextColor(getResources().getColor(R.color.white));
                break;
            case R.id.rl_department://部门
                break;
            case R.id.rl_grouping://分组
                break;
            case R.id.rl_character://关联角色
                break;
            case R.id.btn_start://启用
                btnStart.setBackgroundResource(R.drawable.shape_deal_solved_dialog_pre);
                btnStart.setTextColor(getResources().getColor(R.color.white));
                btnClose.setBackgroundResource(R.drawable.shape_deal_unsolved_dialog_nor);
                btnClose.setTextColor(getResources().getColor(R.color.text_black_color));
                break;
            case R.id.btn_close://挂起
                btnStart.setBackgroundResource(R.drawable.shape_deal_solved_dialog_nor);
                btnStart.setTextColor(getResources().getColor(R.color.text_black_color));
                btnClose.setBackgroundResource(R.drawable.shape_deal_unsolved_dialog_pre);
                btnClose.setTextColor(getResources().getColor(R.color.white));
                break;
            case R.id.rl_email://邮箱
                break;
            case R.id.rl_phone://电话
                break;
            case R.id.rl_contact://联系人
                break;
            case R.id.btn_determine_add://确定添加
                break;
            default:
                break;

        }
    }
}
